<form class="layui-form page-form" action="{:url()}" method="post" id="editForm">
        <div class="layui-form-item">
            <label class="layui-form-label">标题</label>
            <div class="layui-input-inline w300">
                <input type="text" class="layui-input field-title" name="title" lay-verify="required" autocomplete="off" placeholder="[必填] 请输入标题">
            </div>
        </div>
        <div class="layui-form-item upload">
            <label class="layui-form-label">图片</label>
            <button type="button" name="upload" class="layui-btn layui-btn-primary layui-upload" lay-type="image"
                    lay-data="{ exts:'jpg|png|gif|jpeg|ico', accept:'image'}">请上传图片</button>
            <!--<input class="layui-upload-file" type="file" accept="" name="file">-->
            <input type="hidden" class="upload-input field-imgSrc" name="imgSrc" value="">
            <img src="" style="display:none;border-radius:5px;border:1px solid #ccc" width="36" height="36">
        </div>
    <div class="layui-form-item upload">
        <label class="layui-form-label">地址</label>
        <button type="button" name="upload" class="layui-btn layui-btn-primary layui-upload" lay-type="image"
                lay-data="{ exts:'jpg|png|gif|jpeg|ico', accept:'image'}">请上传图片</button>
        <!--<input class="layui-upload-file" type="file" accept="" name="file">-->
        <input type="hidden" class="upload-input field-url" name="url" value="">
        <img src="" style="display:none;border-radius:5px;border:1px solid #ccc" width="36" height="36">
    </div>
        <div class="layui-form-item">
            <label class="layui-form-label"> </label>
            <div class="layui-input-block">
                <input type="hidden" class="field-id" name="id">
                <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="formSubmit">提交</button>
                <a href="{:url('index')}" class="layui-btn layui-btn-primary ml10"><i class="aicon ai-fanhui"></i>返回</a>
            </div>
        </div>
    </form>
    {include file="block/layui" /}
    <script>
        layui.use(['form', 'func','upload'], function() {
            var $ = layui.jquery,
                form = layui.form,
                upload = layui.upload;
            layui.func.assign({:json_encode($formData)});
            form.on('select(group)', function(data) {
                $('#groupShow').html(data.value);
            });

            upload.render({
                elem: '.layui-upload',
                url: '/admin.php/system/annex/upload/thumb/no/water/no.html'
                ,method: 'post'
                ,before: function(input) {
                    layer.msg('文件上传中...', {time:3000000});
                },done: function(res, index, upload) {
                    var obj = this.item;
                    if (res.code == 0) {
                        layer.msg(res.msg);
                        return false;
                    }
                    layer.closeAll();
                    var input = $(obj).parents('.upload').find('.upload-input');
                    if ($(obj).attr('lay-type') == 'image') {
                        input.siblings('img').attr('src', res.data.file).show();
                    }
                    input.val('http://www.hisicms.com'+ res.data.file);
                }
            });
        });
    </script>